<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <title>雨水雨量实时监测系统</title>
	<link rel="stylesheet" type="text/css" th:href="@{/layui-v2.6.8/layui/css/layui.css}"/>
	<script th:src="@{/js/jquery.min.js}"></script>
	<script th:src="@{/layui-v2.6.8/layui/layui.js}"></script>
	<script th:src="@{/js/echarts.min.js}"></script>
	<style>
		body{
			/*background-color: #e2e2e2;*/
			background-image: url("/img/index.jpg");
		}
		.div_main{
			background-color: #F0F0F0;
			height: 750px;
		}
		.div_main_label{
			text-align: center;
			font-size: 24px;
			font-weight: bold; /* 加粗字体 */
		}
	</style>
</head>
<body>
<div>
	<ul class="layui-nav layui-bg-blue" lay-bar="disabled">
		<li class="layui-nav-item"><a href="/rainwater/page/index">首页</a></li>
		<li class="layui-nav-item"><a href="/rainwater/page/show">实时显示</a></li>
		<!--			  <li class="layui-nav-item"><a href="data_user.html">数据查询</a></li>-->
		<li class="layui-nav-item "><a href="/rainwater/page/analysis">数据分析</a></li>
		<li class="layui-nav-item "><a href="/rainwater/page/point">测点管理</a></li>
		<li class="layui-nav-item layui-this"><a href="/rainwater/page/user">用户管理</a></li>
		<li class="layui-nav-item">
			<a th:href="@{/rainwater/page/individual}"><img src="//t.cn/RCzsdCq" class="layui-nav-img">用户</a>
		</li>
	</ul>
</div>
<div class="layui-container div_main" >\
	<br>
	<div class="layui-row">
		<div class="layui-col-md2 layui-col-md-offset5">
			<label class="div_main_label"> 用户管理</label>
		</div>
	</div>
	<hr class="layui-border-green">
	<div class="div_main_table">
		<table class="layui-table">
			<colgroup>
				<col width="150">
				<col width="200">
				<col>
			</colgroup>
			<thead>
			<tr>
				<th>序号</th>
				<th>名字</th>
				<th>身份</th>
				<th>操作</th>
			</tr>
			</thead>
			<tbody th:each="user,num:${userVos}">
			<tr>
				<td th:text="${num.count}">1</td>
				<td th:text="${user.name}">贤心</td>
				<td th:text="${user.identity}"></td>
				<td>
					<button th:onclick="'myConfirm('+${user.getId()}+')'" class="layui-btn layui-btn-warm">修改权限</button>
					<button th:onclick="'deleteUser('+${user.getId()}+')'" class="layui-btn layui-btn-danger">删除</button>
				</td>
			</tr>
			</tbody>
		</table>
	</div>
	<hr class="layui-border-green">
	<div class="layui-row">
		<div class="layui-col-md2 layui-col-md-offset10">
			<div class="layui-col-md4">
				<a th:href="@{'/rainwater/page/user?pageNumber='+${upPage}}" class="layui-btn layui-btn-sm">上一页</a>
			</div>
			<div class="layui-col-md4">
				<a th:href="@{'/rainwater/page/user?pageNumber='+${downPage}}" class="layui-btn layui-btn-sm">下一页</a>
			</div>
		</div>
	</div>
</div>
</body>
</html>
<script>
	function myConfirm(id){
		let success = confirm("是否确定更改权限");
		if (success){
			// console.log("ok")
			window.location.href = "/rainwater/page/user/identity?id="+id
		}else{
			// console.log("no");
		}
	}
	function deleteUser(id){
		let success = confirm("是否确定删除");
		if (success){
			// console.log("ok")
			window.location.href = "/rainwater/page/user/delete?id="+id
		}else{
			// console.log("no");
		}
	}
</script>